<template>
    <view>
        <view class="forget-bg">
            <view class="forget-input forget-margin-b">
                <input type="text" placeholder="用户名" v-model="form.username"></input>
            </view>
            <view class="forget-input forget-margin-b">
                <input type="text" placeholder="密码" v-model="form.passwrod"></input>
            </view>
            <view class="forget-input forget-margin-b">
                <input type="text" placeholder="昵称" v-model="form.nickname"></input>
            </view>
            <view class="forget-input forget-margin-b">
                <input type="number" placeholder="手机号" v-model="form.mobile"></input>
            </view>
            <view class="forget-input forget-margin-b">
                <input type="text" placeholder="email" v-model="form.email"></input>
            </view>
        </view>
        <view class="forget-btm">
            <button class="landing" type="promary" @click="submit">添加</button>
        </view>
    </view>
</template>
<script>
export default{
    data(){
        return{
            form:{
                username:'',
                password:'',
                nickname:'',
                mobile:'',
                email:''
            }
        }
    },
    methods:{
        submit(){
            uniCloud.callFunction({
                name:'addUser',
                data:this.form,
                success:(e)=>{
                    uni.showToast({
                        title:'添加成功',
                        duration:2000
                    })
                    uni.navigateTo({
                        url:'../index/index'
                    })
                }
            })
        }
    }
}
</script>